﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace Tanks
{
    public partial class MainForm : Form
    {
        Tank tank;
        public MainForm()
        {
            InitializeComponent();
            tank = new Tank();
        }

        private void MainForm_MouseClick(object sender, MouseEventArgs e)
        {
            tank.Go(e.X, e.Y);
        }

        private void MainForm_Paint(object sender, PaintEventArgs e)
        {
            e.Graphics.DrawImage(tank.tankImage, tank.X, tank.Y);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!tank.Stop)
            {
                tank.Go();
                Invalidate();
            }
        }

    }
}
